{php include wl_template('common/header');}
<ul class="nav nav-tabs">
	<li ><a href="{php echo web_url('area/areaagent/groupIndex')}">分组列表</a></li>
	{if !empty($category['id'])}
	<li class="active"><a href="#">编辑分组</a></li>
	{else}
	<li {if empty($category['id'])}class="active"{/if}><a href="{php echo web_url('area/areaagent/groupEdit')}">添加分组</a></li>
	{/if}
</ul>
<div class="app-content">
	<div class="app-form">
		<form action="" method="post" class="form-horizontal form form-validate">
			<input type="hidden" name="id" value="{$category['id']}" />
			<div class="panel panel-default">
				<div class="panel-heading">
					分组设置
				</div>
				<div class="panel-body">
					<div class="form-group">
			    		<label class="col-sm-2 control-label">分组名称<span class="must-fill">*</span></label>
			    		<div class="col-sm-9">
			      			<input type="text" name="name" required placeholder="请输入分组名称" class="form-control" value="{$category['name']}">
			    		</div>
			  		</div>
			  		<div class="form-group">
						<label class="col-sm-2 control-label">开放插件</label>
						<div class="col-sm-9">
							{loop $plugins $plugin}
								<label class="checkbox checkbox-inline">
									<input type="checkbox" name="plugins[]" value="{$plugin['ident']}" {if in_array($plugin['ident'], $category['package'])}checked{/if}/>{$plugin['name']}
								</label>
							{/loop}
							<span class="help-block">不勾选则默认包含所有插件</span>
						</div>
					</div>
			  		<div class="form-group">
			    		<label class="col-sm-2 control-label">是否默认</label>
			    		<div class="col-sm-9">
			    			<label class="radio-inline">
			      				<input type="radio" name="isdefault" value="1" {if $category['isdefault'] == 1}checked{/if}>是
			      			</label>
			      			<label class="radio-inline">
		  						<input type="radio" name="isdefault" value="0" {if $category['isdefault'] == 0 || empty($category['isdefault'])}checked{/if}>否
		  					</label>
			    		</div>
			  		</div>
			  		<div class="form-group">
			    		<label class="col-sm-2 control-label">是否开启</label>
			    		<div class="col-sm-9">
			    			<label class="radio-inline">
			      				<input type="radio" name="enabled" value="1" {if $category['enabled'] == 1}checked{/if}>是
			      			</label>
			      			<label class="radio-inline">
		  						<input type="radio" name="enabled" value="0" {if $category['enabled'] == 0 || empty($category['enabled'])}checked{/if}>否
		  					</label>
			    		</div>
			  		</div>
			  		<div class="form-group">
						<label class="col-sm-2 control-label"></label>
					    <div class="col-sm-9">
							<input type="submit" name="submit" lay-submit  value="提交" class="btn btn-primary min-width" />
							<input type="hidden" name="token" value="{$_W['token']}" />
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>
{php include wl_template('common/footer');}